package com.nuoniu.sibanyun.mapper.production;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nuoniu.sibanyun.entity.production.MaMrpDetail;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.math.BigDecimal;

/**
 * <p>
 * 物料需求计划明细表 Mapper 接口
 * </p>
 *
 * @author 小啊刚
 * @since 2023-05-22
 */
public interface MaMrpDatailMapper extends BaseMapper<MaMrpDetail> {

    @Update("update ma_mrp_detail set released_quantity = released_quantity - #{baseQuantity}  where id=#{sourceDetailId}")
    void updateReleasedQuantityReduce(@Param("sourceDetailId") Integer sourceDetailId, @Param("baseQuantity") BigDecimal baseQuantity);
}
